/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

header p {
    color: #7f8c8d;
}

.feature-badges {
    margin-top: 10px;
}

.feature-badge {
    display: inline-block;
    background-color: #e74c3c;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-top: 10px;
    font-weight: bold;
}

.encoding-badge {
    background-color: #3498db;
    margin-left: 10px;
}

.markdown-badge {
    background-color: #27ae60;
    margin-left: 10px;
}

.nav-links {
    margin-top: 15px;
}

.nav-link {
    display: inline-block;
    margin-right: 15px;
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
    padding: 5px 10px;
    border: 1px solid #3498db;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: #3498db;
    color: white;
}

/* Tab切换控件 */
.tab-controls {
    display: flex;
    margin: 20px 20px 0;
    border-bottom: 1px solid #ddd;
}

.tab-button {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: bold;
    color: #555;
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: #3498db;
}

.tab-button.active {
    border-bottom: 3px solid #3498db;
    color: #3498db;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 主要内容区域 */
main {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

/* 上传区域样式 */
.upload-container {
    padding: 40px;
    text-align: center;
    border: 2px dashed #ddd;
    border-radius: 8px;
    margin: 20px;
    transition: all 0.3s ease;
}

.upload-container:hover, .upload-container.dragover {
    border-color: #3498db;
    background-color: rgba(52, 152, 219, 0.05);
}

.upload-icon {
    margin-bottom: 20px;
    color: #3498db;
}

.file-label {
    color: #3498db;
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
}

.file-types {
    margin-top: 15px;
    font-size: 0.8rem;
    color: #95a5a6;
}

.file-note {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #e67e22;
    font-style: italic;
}

.ocr-note {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #3498db;
    font-weight: bold;
}

.encoding-note {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #3498db;
    font-weight: bold;
}

.markdown-note {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #27ae60;
    font-weight: bold;
}

/* 结果区域样式 */
.result-container {
    padding: 20px;
    margin: 20px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.result-actions {
    display: flex;
    gap: 10px;
}

.result-content {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #eaeaea;
    max-height: 600px;
    overflow-y: auto;
    margin-top: 15px;
}

pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', Courier, monospace;
    line-height: 1.5;
}

/* 按钮样式 */
.btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

.btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

/* 加载指示器 */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #3498db;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.loading-note {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #e67e22;
    font-style: italic;
}

.ocr-loading-note {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #3498db;
    font-style: italic;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 信息区域样式 */
.info-section {
    padding: 20px;
    margin: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.info-section h3 {
    color: #3498db;
    margin-bottom: 10px;
}

.info-section ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.info-section a {
    color: #3498db;
    text-decoration: none;
}

.info-section a:hover {
    text-decoration: underline;
}

/* 错误提示样式 */
.error-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.error-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
}

.error-content h3 {
    color: #e74c3c;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.error-content p {
    margin-bottom: 20px;
    color: #333;
    line-height: 1.5;
}

.error-content .btn {
    background-color: #e74c3c;
    float: right;
}

.error-content .btn:hover {
    background-color: #c0392b;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 20px 0;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .result-actions {
        margin-top: 15px;
    }
    
    .error-content {
        width: 95%;
        padding: 15px;
    }
}

/* Markdown预览相关样式 */
.markdown-view-controls {
    display: flex;
    margin: 10px 0;
    border-bottom: 1px solid #eee;
}

.view-btn {
    padding: 8px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
    color: #555;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.view-btn:hover {
    color: #3498db;
}

.view-btn.active {
    border-bottom: 3px solid #3498db;
    color: #3498db;
}

.markdown-preview {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 5px;
    border: 1px solid #eaeaea;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    max-height: 600px;
    overflow-y: auto;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3 {
    color: #2c3e50;
    margin: 1em 0 0.5em;
}

.markdown-preview h1 {
    font-size: 1.8em;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.3em;
}

.markdown-preview h2 {
    font-size: 1.5em;
}

.markdown-preview h3 {
    font-size: 1.3em;
}

.markdown-preview strong {
    font-weight: bold;
}

.markdown-preview em {
    font-style: italic;
}

.markdown-preview ul {
    margin-left: 20px;
    margin-bottom: 1em;
}

.markdown-preview li {
    margin-bottom: 0.5em;
}

.markdown-preview code {
    font-family: monospace;
    background-color: #eee;
    padding: 2px 4px;
    border-radius: 3px;
}

.markdown-preview pre {
    background-color: #f1f1f1;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1em 0;
}

.markdown-preview pre code {
    background-color: transparent;
    padding: 0;
}

.markdown-preview a {
    color: #3498db;
    text-decoration: none;
}

.markdown-preview a:hover {
    text-decoration: underline;
}

.markdown-preview hr {
    border: 0;
    height: 1px;
    background-color: #eee;
    margin: 1em 0;
}

/* 多语言切换按钮 */
.language-switch {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    z-index: 100;
}

.language-btn {
    padding: 5px 10px;
    background-color: #f5f7fa;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-left: 5px;
    transition: all 0.3s ease;
}

.language-btn:hover {
    background-color: #e6e6e6;
}

.language-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* Markdown表格样式 */
.md-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    overflow-x: auto;
    display: block;
    max-width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.md-table thead {
    background-color: #f8f9fa;
}

.md-table th,
.md-table td {
    padding: 10px 15px;
    border: 1px solid #ddd;
    text-align: left;
    word-break: break-word;
    min-width: 100px;
}

.md-table th {
    background-color: #f2f2f2;
    font-weight: bold;
    position: sticky;
    top: 0;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.md-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.md-table tr:hover {
    background-color: #f0f0f0;
}

/* Markdown图片样式 */
.markdown-preview img,
.md-image {
    max-width: 100%;
    height: auto;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    margin: 10px 0;
    display: block;
    cursor: pointer;
    transition: all 0.3s ease;
}

.markdown-preview img:hover,
.md-image:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: scale(1.01);
}

/* 图片全屏模式 */
.md-image-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    padding: 0;
    object-fit: contain;
    z-index: 9999;
    background-color: rgba(0, 0, 0, 0.9);
    border: none;
    border-radius: 0;
    box-shadow: none;
    cursor: zoom-out;
}

/* 代码块样式 */
.markdown-preview pre {
    background-color: #f5f7f9;
    border-radius: 4px;
    padding: 15px;
    overflow-x: auto;
    margin: 15px 0;
}

.markdown-preview code,
.md-code-block {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    padding: 2px 4px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.markdown-preview pre code,
pre .md-code-block {
    padding: 0;
    background-color: transparent;
    border-radius: 0;
    display: block;
    line-height: 1.5;
}

/* 新增: 页脚样式 */
.github-links {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.github-link {
    color: #3498db;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.github-link:hover {
    text-decoration: underline;
}

.github-icon {
    width: 16px;
    height: 16px;
    margin-right: 5px;
}

@media (max-width: 768px) {
    .md-table {
        font-size: 0.85em;
    }
    
    .md-table th,
    .md-table td {
        padding: 5px 8px;
    }
    
    .github-links {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
}

/* API文档测试区域样式 */
.api-test-container {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #e1e4e8;
}

.api-test-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.api-test-tab {
    padding: 8px 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
    color: #555;
    margin-right: 5px;
    border-bottom: 2px solid transparent;
}

.api-test-tab.active {
    color: #3498db;
    border-bottom: 2px solid #3498db;
}

.api-test-content {
    display: none;
}

.api-test-content.active {
    display: block;
}

.api-form {
    margin-bottom: 15px;
}

.api-form-group {
    margin-bottom: 10px;
}

.api-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.api-form-group input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.api-submit-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.api-submit-btn:hover {
    background-color: #2980b9;
}

.api-response {
    margin-top: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.api-response-header {
    background-color: #f2f2f2;
    padding: 8px 12px;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
}

.api-response-body {
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
    background-color: #fff;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-all;
}

.api-response.success .api-response-header {
    background-color: #dff0d8;
    color: #3c763d;
}

.api-response.error .api-response-header {
    background-color: #f2dede;
    color: #a94442;
}

/* 全屏按钮 */
.fullscreen-btn {
    background-color: #6c757d;
}

.fullscreen-btn:hover {
    background-color: #5a6268;
}

.fullscreen-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 5px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M1.5 1a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4A1.5 1.5 0 0 1 1.5 0h4a.5.5 0 0 1 0 1h-4zM10 .5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 16 1.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zM.5 10a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 0 14.5v-4a.5.5 0 0 1 .5-.5zm15 0a.5.5 0 0 1 .5.5v4a1.5 1.5 0 0 1-1.5 1.5h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: middle;
}

/* 全屏预览覆盖层 */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.98);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.fullscreen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #3498db;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fullscreen-header h3 {
    margin: 0;
    font-size: 1.2em;
}

.close-fullscreen-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0 10px;
}

.fullscreen-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.fullscreen-preview {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    min-height: 100%;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .fullscreen-preview {
        padding: 15px;
    }
    
    .result-content,
    .markdown-preview {
        max-height: 400px;
    }
}

/* API 文档样式 */
.api-docs {
    margin: 20px auto;
    padding: 20px;
    max-width: 1200px;
}

.api-tab-controls {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.api-tab-button {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-bottom: none;
    padding: 10px 15px;
    cursor: pointer;
    margin-right: 5px;
    border-radius: 5px 5px 0 0;
}

.api-tab-button.active {
    background-color: #ffffff;
    border-bottom: 2px solid #333;
}

.api-tab-content {
    display: none;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 0 5px 5px 5px;
}

.api-tab-content.active {
    display: block;
}

.endpoint {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    font-family: monospace;
    display: inline-block;
}

.endpoint .method {
    background-color: #28a745;
    color: white;
    padding: 3px 6px;
    border-radius: 3px;
    margin-right: 10px;
    font-weight: bold;
}

.api-params {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.api-params th, .api-params td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.api-params th {
    background-color: #f8f9fa;
}

.alert-box {
    background-color: #f8f9fa;
    border-left: 4px solid #28a745;
    padding: 15px;
    margin: 15px 0;
}

.code-example {
    margin: 20px 0;
}

/* URL转Markdown样式 */
.url-input-container {
    padding: 30px;
    margin: 20px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.url-input-form {
    max-width: 700px;
    margin: 0 auto;
}

.url-input-group {
    margin-bottom: 20px;
}

.url-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
}

.url-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: border-color 0.3s;
}

.url-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.25);
}

.url-options {
    margin-bottom: 20px;
}

.url-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.url-option input[type="checkbox"] {
    margin-right: 8px;
}

.url-description {
    margin-top: 25px;
    border-top: 1px solid #eee;
    padding-top: 20px;
    color: #666;
    font-size: 0.9em;
    line-height: 1.6;
}

.url-description p {
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .url-input-form {
        padding: 15px;
    }
    
    .url-input {
        padding: 10px;
    }
} 